﻿@using vITs.Site.Models
@{
    ViewBag.Title = "Mina Uppdrag";
}

<fieldset>
    <legend>
        <h2>Mina Uppdrag</h2>
    </legend>
    <br />
    @Html.ActionLink("Skapa Uppdrag", "CreateAssignment", "Assignment")
    <br />
    @foreach (var key in this.ViewBag.Assignments.Keys)
    {
        String status = ((vITs.Site.Models.DataModels.AssignmentStatus)key).GetDisplayName();
        
        <fieldset>
            <legend>@status</legend>
            <br />
            <ul>
            @foreach (var assignment in this.ViewBag.Assignments[key])
            {
                <li>
                    <a href="@this.Url.Action("ViewAssignment", "Consultant", new { AssignmentId = @assignment.AssignmentId })">@assignment.AssignmentName</a> (@assignment.StartDate.ToString("yyyy-MM-dd") &mdash; @assignment.EndDate.ToString("yyyy-MM-dd"))
                </li>
            }
            </ul>
        </fieldset>
    }
</fieldset>
